package com.zenchn.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel(value="系统权限",description="系统权限对象")
public class TSysAuthority implements Serializable {
    private static final long serialVersionUID = -2194241039948704711L;
    @ApiModelProperty(value="权限ID")
    private String authId;

    @ApiModelProperty(value="创建时间",hidden = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @NotEmpty(message = "权限类型ID不能为空")
    @ApiModelProperty(value="权限类型ID")
    private String authTypeId;

    @NotEmpty(message = "权限名称不能为空")
    @ApiModelProperty(value="权限名称")
    private String authName;

    @ApiModelProperty(value="图标样式")
    private String iconStyle;

    @NotEmpty(message = "权限标识不能为空")
    @ApiModelProperty(value="权限标识")
    private String authSign;

    @ApiModelProperty(value="菜单访问url")
    private String url;

    @ApiModelProperty(value="链接打开方式(参考 html<a>标签 target)")
    private String target;

    @NotNull(message = "排序不能为空")
    @ApiModelProperty(value="排序")
    private Short sorts;

    @ApiModelProperty(value="上级权限ID")
    private String parentId;

    @ApiModelProperty(value="权限层级",hidden = true)
    private Integer authLevel;

    @NotEmpty(message = "权限所属客户端ID不能为空")
    @ApiModelProperty(value="权限所属客户端ID")
    private String oauthClientId;

    @ApiModelProperty(value="备注说明")
    private String memo;

    public String getAuthId() {
        return authId;
    }

    public void setAuthId(String authId) {
        this.authId = authId == null ? null : authId.trim();
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getAuthTypeId() {
        return authTypeId;
    }

    public void setAuthTypeId(String authTypeId) {
        this.authTypeId = authTypeId == null ? null : authTypeId.trim();
    }

    public String getAuthName() {
        return authName;
    }

    public void setAuthName(String authName) {
        this.authName = authName == null ? null : authName.trim();
    }

    public String getIconStyle() {
        return iconStyle;
    }

    public void setIconStyle(String iconStyle) {
        this.iconStyle = iconStyle == null ? null : iconStyle.trim();
    }

    public String getAuthSign() {
        return authSign;
    }

    public void setAuthSign(String authSign) {
        this.authSign = authSign == null ? null : authSign.trim();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target == null ? null : target.trim();
    }

    public Short getSorts() {
        return sorts;
    }

    public void setSorts(Short sorts) {
        this.sorts = sorts;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId == null ? null : parentId.trim();
    }

    public Integer getAuthLevel() {
        return authLevel;
    }

    public void setAuthLevel(Integer authLevel) {
        this.authLevel = authLevel;
    }

    public String getOauthClientId() {
        return oauthClientId;
    }

    public void setOauthClientId(String oauthClientId) {
        this.oauthClientId = oauthClientId == null ? null : oauthClientId.trim();
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", authId=").append(authId);
        sb.append(", createTime=").append(createTime);
        sb.append(", authTypeId=").append(authTypeId);
        sb.append(", authName=").append(authName);
        sb.append(", iconStyle=").append(iconStyle);
        sb.append(", authSign=").append(authSign);
        sb.append(", url=").append(url);
        sb.append(", target=").append(target);
        sb.append(", sorts=").append(sorts);
        sb.append(", parentId=").append(parentId);
        sb.append(", authLevel=").append(authLevel);
        sb.append(", oauthClientId=").append(oauthClientId);
        sb.append(", memo=").append(memo);
        sb.append("]");
        return sb.toString();
    }
}